<template>
	<div class="u-page" style="background:#f7f7f7">
		<section class="aui-flexView">
			<section class="aui-scrollView">
				<div class="aui-order-box">
					<div class="aui-flex aui-choice-white u-parent">
						<div class="aui-flex-box">
							<h1>测评清单1件</h1>
						</div>
					</div>
					<div class="aui-flex aui-flex-default aui-mar15" @click="toProductDetail">
						<div class="aui-flex-goods">
							<img :src="product.CommodityPicture.split(',')[0]" alt="">
						</div>
						<div class="aui-flex-box">
							<h2>{{product.CommodityName}}</h2>
							<div class="aui-flex-tags u-scroll-x">
								<u-tag
									  v-for="(item, index) in product.KeyWord.split(',')"
									  :key="index"
									  :text="item"
									  type="primary"
									  mode="dark"
									  size="mini"
								></u-tag>
							</div>
							<div class="aui-flex aui-flex-clear">
								<div class="aui-flex-box">￥{{product.CommodityPrice}}/件</div>
							</div>
						</div>
					</div>
					
					<!-- 基本设置 -->
					<div class="aui-flex aui-choice-white b-line u-center u-font-bold u-pt-15 u-pb-15">
						<u-divider color="#eb5468" fontSize="30" border-color="#eb5468" bg-color="#fffbfe">基本设置</u-divider>
					</div>
					<div class="aui-flex aui-choice-white b-line">
						<div class="aui-flex-box">
							<h1>商品主图</h1>
							<div class="Tips">
								<span style=" color: #f02323;">请上传图片，若多张则默认最后一张为活动首图！</span>
							</div>
						</div>
					</div>
					<div class="aui-flex aui-choice-white b-line">
						<Upload u_appid="ProductPromote" u_fieldName="MainPicture" :u_orunid="docUnid" u_type="0"
							:u_initialAttchments="MainPictureFiles" @receiveAttachmentsData="getMainPictureFiles"></Upload>
					</div>
					
					<!-- 分割线 -->
					<div class="aui-flex aui-choice-white b-line">
						<div class="aui-flex-box">报名截止时间<span class="u-pl-5">
								<u-icon name="question-circle" top="1" size="30" @click="showTips('JoinEndTime')">
								</u-icon>
							</span></div>
						<div class="aui-flex-triangle" @click="JoinEndTime_Show = true">
							<span v-if="product.JoinEndTime">{{product.JoinEndTime}}</span>
							<span v-else>请选择</span>
						</div>
						<u-picker v-model="JoinEndTime_Show" mode="time" @confirm="SelectJoinEndTime($event)">
						</u-picker>
					</div>
					
					<div class="aui-flex aui-choice-white b-line">
						<div class="aui-flex-box">提交成果周期(天)<span class="u-pl-5">
								<u-icon name="question-circle" top="1" size="30" @click="showTips('LimitDays')">
								</u-icon>
							</span></div>
						<u-number-box v-model="product.LimitDays"></u-number-box>
					</div>
					
					<div class="aui-flex aui-choice-white b-line">
						<div class="aui-flex-box">评级时间<span class="u-pl-5">
								<u-icon name="question-circle" top="1" size="30" @click="showTips('EndTime')"></u-icon>
							</span></div>
						<div class="aui-flex-triangle" @click="EndTime_Show = true">
							<span v-if="product.EndTime">{{product.EndTime}}</span>
							<span v-else>请选择</span>
						</div>
						<u-picker v-model="EndTime_Show" mode="time" @confirm="SelectEndTime($event)"></u-picker>
					</div>
					
					<div class="aui-flex aui-choice-white b-line">
						<div class="aui-flex-box">验收/评级成员<span class="u-pl-5">
								<u-icon name="question-circle" top="1" size="30" @click="showTips('Rate')"></u-icon>
							</span></div>
						<div class="aui-flex-triangle" @click="toSelectUsers">
							<span>{{Inspector.MemberName}}</span>
						</div>
					</div>
					
					<div class="aui-flex aui-choice-white b-line">
						<div class="aui-flex-box">测评客服<span class="u-pl-5">
								<u-icon name="question-circle" top="1" size="30" @click="showTips('CS')"></u-icon>
							</span></div>
						<div class="aui-flex-triangle" @click="CS_Show = true">{{csNameText?csNameText:'请选择'}}</div>
						<u-select v-model="CS_Show" :list="CSRange" @confirm="SelectCS"></u-select>
					</div>
					
					<div class="aui-flex aui-choice-white b-line">
						<div class="aui-flex-box">限制报名周期(天)<span class="u-pl-5">
								<u-icon name="question-circle" top="1" size="30" @click="showTips('JoinLimitDays')"></u-icon>
							</span></div>
						<div class="aui-flex-triangle" @click="JoinLimitDays_Show = true">{{JoinLimitDays_text}}
						</div>
						<u-picker mode="selector" v-model="JoinLimitDays_Show" :default-selector="[0]"
							:range="JoinLimitDaysRange" @confirm="JoinLimitDays_text = JoinLimitDaysRange[$event]"></u-picker>
					</div>
					
					<div class="aui-flex aui-choice-white aui-mar15">
						<div class="aui-flex-box">关键字</div>
						<div class="u-flex u-col-center">
							<!-- 已添加的标签列表 -->
							<div class="u-scroll-x u-mr-5" style="width: 450rpx;">
								<u-tag v-for="(item, index) in KeyWordList" :key="index" :text="item.label" type="info"
									mode="dark" close-color="#828282" @click="onCloseTag(index)"></u-tag>
						 </div>
							<!-- 添加标签按钮 -->
							<div class="u-center">
								<u-icon class="u-pointer" name="plus-circle" size="46"
									@click="toTagSettingPage(KeyWordList, 1)"></u-icon>
							</div>
						</div>
					</div>
					
					<!-- 活动受众 -->
					<div class="aui-flex aui-choice-white b-line u-center u-font-bold u-pt-15 u-pb-15">
						<u-divider color="#eb5468" fontSize="30" border-color="#eb5468" bg-color="#fffbfe">活动受众</u-divider>
					</div>
					
					<div class="aui-flex aui-choice-white b-line">
						<div class="aui-flex-box">活动面向群体<span class="u-pl-5">
								<u-icon name="question-circle" top="1" size="30" @click="showTips('EnableProviderJoinLimit')"></u-icon>
							</span></div>
						<div class="aui-flex-triangle" @click="EnableProviderJoinLimit_Show = true">
							<span v-if="EnableProviderJoinLimit_text">{{EnableProviderJoinLimit_text}}</span>
							<span v-else>请选择</span>
						</div>
						<u-picker mode="selector" v-model="EnableProviderJoinLimit_Show" :default-selector="[0]"
							:range="EnableProviderJoinLimitRange" @confirm="EnableProviderJoinLimit_text = EnableProviderJoinLimitRange[$event]"></u-picker>
					</div>
					
					<div class="aui-flex aui-choice-white b-line">
						<div class="aui-flex-box">等级要求<span class="u-pl-5">
								<u-icon name="question-circle" top="1" size="30" @click="showTips('RestrictionLevel')"></u-icon>
							</span>
						</div>
						<div class="aui-flex-triangle" @click="RestrictionLevel_Show = true">{{RestrictionLevel_text}}</div>
						<u-picker mode="selector" v-model="RestrictionLevel_Show" :default-selector="[0]"
							:range="RestrictionLevelRange" @confirm="RestrictionLevel_text = RestrictionLevelRange[$event]"></u-picker>
					</div>
					
					<div class="aui-flex aui-choice-white b-line aui-mar15">
						<div class="aui-flex-box">新老用户规则<span class="u-pl-5">
								<u-icon name="question-circle" top="1" size="30" @click="showTips('UserRatio')">
								</u-icon>
							</span></div>
						<div class="aui-flex-triangle" @click="UserRatio_Show = true">{{UserRatio.Text}}</div>
						<u-picker mode="selector" v-model="UserRatio_Show" :default-selector="[10]"
							:range="UserRatioRange" range-key="Text" @confirm="UserRatio = UserRatioRange[$event]">
						</u-picker>
					</div>
					
					<!-- 活动要求 -->
					<div class="aui-flex aui-choice-white b-line u-center u-font-bold u-pt-15 u-pb-15">
						<u-divider color="#eb5468" fontSize="30" border-color="#eb5468" bg-color="#fffbfe">活动要求</u-divider>
					</div>
					<!-- 分割线 -->
					<div class="aui-flex aui-choice-white b-line">
						<div class="aui-flex-box">测评需求</div>
						<div class="aui-flex-triangle" @click="toSelectEvaluationDemand" style="width: 450rpx;text-align: right;">
							<span v-if="EvaluationDemand.subject">{{EvaluationDemand.subject}}</span>
							<span v-else>请选择</span>
						</div>
					</div>
					
					<div class="aui-flex aui-choice-white b-line aui-mar15">
						<div class="aui-flex-box">样品发放规则</div>
						<div class="aui-flex-triangle" @click="SampleDeliveryRules_Show = true">
							<span v-if="SampleDeliveryRules_text">{{SampleDeliveryRules_text}}</span>
							<span v-else>请选择</span>
						</div>
						<u-picker mode="selector" v-model="SampleDeliveryRules_Show" :default-selector="[0]"
							:range="SampleDeliveryRulesRange" @confirm="SampleDeliveryRules_text = SampleDeliveryRulesRange[$event]"></u-picker>
					</div>
					
					<!-- 分销设置 -->
					<div class="aui-flex aui-choice-white b-line u-center u-font-bold u-pt-15 u-pb-15">
						<u-divider color="#eb5468" fontSize="30" border-color="#eb5468" bg-color="#fffbfe">分销设置</u-divider>
					</div>
					<!-- 分割线 -->
					<div class="aui-flex aui-choice-white b-line">
						<div class="aui-flex-box">开启商品团销<span class="u-pl-5">
								<u-icon name="question-circle" top="1" size="30" @click="showTips('EnableDistribution')">
								</u-icon>
							</span></div>
						<div class="aui-flex-triangle" @click="EnableDistribution_Show = true">
							<span v-if="EnableDistribution_text">{{EnableDistribution_text}}</span>
							<span v-else>请选择</span>
						</div>
						<u-picker mode="selector" v-model="EnableDistribution_Show" :default-selector="[0]"
							:range="EnableDistributionRange" @confirm="EnableDistribution_text = EnableDistributionRange[$event]"></u-picker>
					</div>
					
					<div v-if="EnableDistribution_text == '是'">
						<div class="aui-flex aui-choice-white b-line">
							<div class="aui-flex-box">玫丽专享价(元)
								<span class="u-pl-5">
									<u-icon name="question-circle" top="1" size="30" @click="showTips('CommodityPrice')"></u-icon>
								</span>
							</div>
							<u-input v-model="product.CommodityPrice" disabled="true" input-align="right"/>
						</div>
						<div class="aui-flex aui-choice-white b-line">
							<div class="aui-flex-box">消费者分享报酬(￥)
								<span class="u-pl-5">
									<u-icon name="question-circle" top="1" size="30" @click="showTips('ConsumerShareReward')"></u-icon>
								</span>
							</div>
							<u-input v-model="product.ConsumerShareReward" disabled="true" input-align="right"/>
						</div>
						<div class="aui-flex aui-choice-white b-line">
							<div class="aui-flex-box">销售报酬(￥)
								<span class="u-pl-5">
									<u-icon name="question-circle" top="1" size="30" @click="showTips('DistributionReward')"></u-icon>
								</span>
							</div>
							<u-input v-model="product.DistributionReward" disabled="true" input-align="right"/>
						</div>
					</div>
				</div>
			</section>

			<div style="height: 30px;"></div>

			<div class="aui-bar-footer">
				<div class="aui-flex">
					<div class="aui-flex-box">
						应付金额：<span>￥{{EvaluationDemand.purchasePrice?EvaluationDemand.purchasePrice:'0'}}</span>
					</div>
					<div>
						<u-button :disabled="isClick"
							:custom-style="{background:'#eb5468',padding:'52rpx 50rpx',color:'#fff',fontSize:'28rpx',borderRadius:'0rpx'}"
							@click="GoToPay">去支付</u-button>
					</div>
				</div>
			</div>

			<!-- 点击问号弹出提示窗 -->
			<div>
				<u-modal v-model="TipsShow" :content="TipsContent"></u-modal>
			</div>

			<!-- 弹窗【报名截止时间不能选择今天之前的日期】 -->
			<u-modal ref="uModal" title="平台提示" v-model="show" confirm-text="确认">
				<div class="u-p-20">
					<p>报名截止时间不能选择今天之前的日期！请重新选择</p>
				</div>
			</u-modal>

			<!-- 弹窗【评级时间应大于报名截止时间加上提交测评报告周期】 -->
			<u-modal ref="uModal" title="平台提示" v-model="show1" confirm-text="确认">
				<div class="u-p-20">
					<p>“评级时间”应大于“评级时间”+“提交测评报告周期”。最好能大于1-2天，预留的时间可用于验收。</p>
				</div>
			</u-modal>
			
			<!-- 再次执行“订单是否支付成功”查询 -->
			<u-modal ref="uModal" title="平台提示" v-model="showPayInfo" confirm-text="确认" @confirm="doQueryWxPayOk('second')">
				<div class="u-p-20">
					<p>订单未支付成功，请重试！</p>
				</div>
			</u-modal>
			
		</section>

		<!-- 选择支付的方式 -->
		<u-popup v-model="showItem" mode="bottom" @close="closePopup">
			<div class="popup-box">
				<div class="popup-item" v-for="(item, index) in chooseTypes" @click="clickPopup(item)">
					<div>{{item.text}}</div>
				</div>
			</div>
		</u-popup>

	</div>
</template>

<script>
	import globalData from "@/globalData";
	export default {
		data() {
			return {
				docUnid: '',// 文档id
				product: {},// 商品信息
				KeyWordList: [], // 关键字
				MainPictureFiles: [],
				CS_Show: false, // 客服选择弹窗控制
				CSRange: [],
				csNameText: '',
				UserRatio_Show: false, // 新老用户规则选择弹窗控制
				UserRatioRange: [],
				UserRatio: {},
				JoinLimitDays_Show: false,
				JoinLimitDaysRange: ['0','1','2','3','4','5','6','7','8','9','10','11','12','13', '15', '22', '31'], // 默认0
				JoinLimitDays_text: '0',// 报名1次限制周期(天)
				RestrictionLevel_Show: false,
				RestrictionLevelRange: ['A级', 'B级+', 'C级+', 'D级+', 'E级+', 'F级+'],
				RestrictionLevel_text: '',// 等级要求
				EnableProviderJoinLimit_Show: false,// 活动面向群体。0:测评师；1:区域服务商
				EnableProviderJoinLimitRange: ['测评师', '区域服务商'],
				EnableProviderJoinLimit_text: '测评师',
				SampleDeliveryRules_Show: false,// 样品发放规则。0:自行购买；1:厂家发货；
				SampleDeliveryRulesRange: ['自行购买', '厂家发货'],
				SampleDeliveryRules_text: '自行购买',
				EnableDistribution_Show: false, // 是否开启分销功能弹窗控制
				EnableDistributionRange: ['否', '是'],
				EnableDistribution_text: '',
				JoinEndTime_Show: false, // 报名截止时间选择弹窗控制
				EndTime_Show: false, //评级时间选择弹窗控制
				LimitDays_Show: false, //提交报名的默认时长选择弹窗控制
				isClick: false,
				Inspector: {
					Member: '',
					MemberName: '',
					avatarUrl: ''
				},
				PrivateTeam: {},
				TipsShow: false,
				show: false,
				show1: false,
				TipsContent: '',
				TipsContentObj: {},// 提示语
				showItem: false,
				PrivilegedStatus: '', // 是否为支付特权人员。yes:是；no:否。默认：no
				chooseTypes: [
					{
						text: '全额付款',
						action: 'fullPayment'
					},
					{
						text: '支付0.01元',
						action: 'payALittle'
					},
					{
						text: '取消',
						action: 'closePopup'
					}
				],
				showPayInfo: false,
				EvaluationDemand: {},// 测评需求（后台录入的）
			}
		},

		onLoad(options) {
			// 未登录跳转到登录页面
			var loginRes = this.checkLogin()
			if (!loginRes) {
				return false;
			}
			
			let product_info = decodeURIComponent(options.product);
			this.product = JSON.parse(product_info);
			// 此对象里面包含了客服id，即：
			// this.product.CSID = goods.openKfid 商品客服，若查询不到测评客服，则默认为商品客服
			console.log("this.product=", this.product)
			
			// 初始化商品基本信息
			this.product.LimitDays = 3; // 提交测评报告周期
			this.product.JoinEndTime = '';
			this.JoinLimitDays_text = this.JoinLimitDaysRange[0];
			this.EnableProviderJoinLimit_text = this.EnableProviderJoinLimitRange[0];
			this.EnableDistribution_text = this.EnableDistributionRange[0];
			this.RestrictionLevel_text = '请选择';
			
			// 初始化验收人为发起人（即当前用户）
			this.initInspector();
			
			// 初始化文档id
			this.getNewDocUnid();
			
			// 获取新老用户规则
			this.getUserRatio();
			
			// 获取客服人员列表
			// this.getCSRange();
			this.getKFRange();
			
			// 根据userid获取支付特权状态
			this.getPrivilegedStatus();
			
			// 获取提示语
			this.getTipsContentObj();

			// 保存选中的标签列表
			uni.$on("saveTagList", (tagList = []) => {
				this.KeyWordList = tagList;
			});
			
			// 保存选中的验收人列表
			uni.$on("saveUserList", (userList = []) => {
				if (userList.length > 0) {
					this.Inspector = userList[0]
				} else {
					this.initInspector()
				}
			});

			// 保存选中的组队团队列表
			uni.$on("saveTeamList", (teamList = []) => {
				if (teamList.length > 0) {
					this.PrivateTeam = teamList[0]
				} else {
					this.PrivateTeam = {}
				}
			});
			
			// 保存选中的测评需求
			uni.$on("saveDemand", (demandObj = {}) => {
				this.EvaluationDemand = demandObj;
				
				// 若字段不是金额类型，则直接赋值为0
				if(!this.checkMoney(this.EvaluationDemand.purchasePrice)){
					this.EvaluationDemand.purchasePrice = 0
				}
				
			});
		},
		
		onUnload() {
		    uni.$off("saveTagList");
			uni.$off("saveUserList");
			uni.$off("saveTeamList");
			uni.$off("saveDemand");
		},
		  
		methods: {
			
			/**
			 * 校验是否为金额类型
			 */
			checkMoney(money) {
				if (this.isNotNull(money)) {
					const reg = /^\d+(\.\d{0,2})?$/;
					return reg.test(money);
				}
				return false;
			},
			
			/**
			 * 初始化验收人为发起人（即当前用户）
			 */
			initInspector() {
				// 验收人默认值为当前用户
				this.Inspector.Member = uni.getStorageSync('userInfo').userId
				this.Inspector.MemberName = uni.getStorageSync('userInfo').nickName
				this.Inspector.avatarUrl = uni.getStorageSync('userInfo').avatarUrl
			},
			
			/**
			 * 初始化文档id
			 */
			async getNewDocUnid() {
				let result = await this.$u.api.unifyRequest({
					appid: 'ProductPromote',
					wf_num: 'R_ProductPromote_B001',
					loading: true // 默认发起请求会有一个全局的Loading，设置false可去掉
				});
				if (result.code == 200) {
					this.docUnid = result.data
				}
			},
			
			/**
			 * 获取新老用户规则
			 */
			async getUserRatio() {
				let result = await this.$u.api.unifyRequest({
					appid: 'ProductPromote',
					wf_num: 'R_ProductPromote_B005',
					loading: true // 默认发起请求会有一个全局的Loading，设置false可去掉
				});
				if (result.code == 200) {
					this.UserRatioRange = result.data
					this.UserRatio = this.UserRatioRange[10]
				}
			},

			/**
			 * 获取客服人员列表（BPM）
			 */
			async getCSRange() {
				const userInfo = uni.getStorageSync('userInfo');
				let result = await this.$u.api.unifyRequest({
					userId: userInfo.userId,
					nickName: userInfo.nickName,
					appid: 'ProductPromote',
					wf_num: 'R_ProductPromote_B011',
					SceneID: this.product.SceneAssetsId, // 定制ID
					loading: true // 默认发起请求会有一个全局的Loading，设置false可去掉
				});
				if (result.code == 200) {
					this.CSRange = result.data
					this.csNameText = this.CSRange[0].label;
				}
			},
			
			/**
			 * 获取客服人员列表
			 */
			async getKFRange() {
				let result = await this.$u.api.unifyMiniRest({
					systemid: "meily",
					url: "/qyapi/kf/account/list/applet",
					name: "测评",
					loading: false // 默认发起请求会有一个全局的Loading，设置false可去掉
				});
				if (result.code == 200) {
					let rows = result.data;
					if(rows.length > 0){
						for(let i in rows){
							let obj = {
								value: rows[i].openKfid,
								label: rows[i].name,
							}
							this.CSRange.push(obj)
						}
						if(this.CSRange.length > 0){
							this.product.CSID = this.CSRange[0].value;// 默认选择
							this.csNameText = this.CSRange[0].label;
						}
					}
				}
			},

			/**
			 * 根据userid获取支付特权状态
			 */
			async getPrivilegedStatus() {
				const userInfo = uni.getStorageSync('userInfo')
				let result = await this.$u.api.unifyMiniRestGet({
					systemid: "meily",
					url: "/user/canQuickPay/" + userInfo.userId,
					loading: false // 默认发起请求会有一个全局的Loading，设置false可去掉
				});
				if (result.code == 200) {
					this.PrivilegedStatus = result.data
				}
				/* const userInfo = uni.getStorageSync('userInfo')
				let result = await this.$u.api.unifyRequest({
					userId: userInfo.userId,
					nickName: userInfo.nickName,
					appid: 'ProductPromote',
					wf_num: 'R_ProductPromote_B008',
					loading: false // 默认发起请求会有一个全局的Loading，设置false可去掉
				});
				if (result.code == 200) {
					this.PrivilegedStatus = result.data
				} */
			},
			
			/**
			 * 获取提示语
			 */
			async getTipsContentObj() {
				const userInfo = uni.getStorageSync('userInfo')
				let result = await this.$u.api.unifyRequest({
					userId: userInfo.userId,
					nickName: userInfo.nickName,
					appid: 'ProductPromote',
					wf_num: 'R_ProductPromote_B012',
					loading: false // 默认发起请求会有一个全局的Loading，设置false可去掉
				});
				if (result.code == 200) {
					this.TipsContentObj = result.data
				}
			},

			/**
			 * 添加标签
			 */
			async toTagSettingPage(prevPageIsSelectList = [], mode = 1) {
				uni.setStorageSync("prevPageIsSelectList", prevPageIsSelectList);
				this.$u.route(`/pages_tabbar_contact/common_contact/tag?mode=${mode}`);
			},

			/**
			 * 移除标签
			 */
			onCloseTag(index) {
				this.KeyWordList.splice(index, 1);
			},

			/**
			 * 跳转到商品的详情
			 */
			toProductDetail() {
				// 商品详情页（可选择发起测评或团购）
				this.$u.route('/pages_private_scene2/SceneModule/ProductDetails?SceneAssetsId=' + this.product
					.SceneAssetsId + '&SceneID=' + this.product.SceneID + '&CommodityNo=' + this.product.CommodityNo)
			},

			/**
			 * 跳转到选择团队页面
			 */
			toSelectTeams() {
				this.$u.route('/pages_private_scene2/ProductPromote/common/selectTeams?SceneAssetsId=' + this.product
					.SceneAssetsId + '&owner=' + uni.getStorageSync('userInfo').userId + '&TeamNo=' + this.PrivateTeam
					.TeamNo + '&TeamName=' + this.PrivateTeam.TeamName)
			},

			/**
			 * 跳转到选人页面
			 */
			toSelectUsers() {
				this.$u.route('/pages_private_scene2/ProductPromote/common/selectUsers?SceneAssetsId=' + this.product
					.SceneAssetsId + '&owner=' + uni.getStorageSync('userInfo').userId + '&limit=1&selectUsers=' + this
					.getUserIdsByCurrent())
			},
			
			/**
			 * 跳转到选择测评需求页面
			 */
			toSelectEvaluationDemand() {
				this.$u.route('/pages_private_scene2/ProductPromote/common/selectDemand')
			},
			
			/**
			 * 获取当前成员列表的用户id串，用,隔开
			 */
			getUserIdsByCurrent() {
				let selectUsers = this.Inspector.Member;
				/* for(let i in this.members){
					if(selectUsers != ''){
						selectUsers += "," + this.members[i].Member
					} else {
						selectUsers = this.members[i].Member
					}
				} */
				return selectUsers;
			},
			
			/**
			 * 选择客服
			 * @param {Object} e
			 */
			SelectCS(event){
				this.csNameText = event[0].label;
				this.product.CSID = event[0].value;
			},

			/**
			 * 选择报名截止时间
			 * @param {Object} e
			 */
			async SelectJoinEndTime(e) {
				let today = new Date().toLocaleDateString(); // 获取当前日期
				let dateStr = e.year + "-" + e.month + "-" + e.day;
				let diffValue = this.comparisonDate(dateStr, today);
				if (diffValue >= 0) {
					this.product.JoinEndTime = dateStr;
				} else {
					this.show = true;
				}
			},

			/**
			 * 选择评级时间
			 * @param {Object} e
			 */
			async SelectEndTime(e) {

				// 评级时间 > 报名截止时间 + 提交测评报告周期
				let JoinEndTime = this.product.JoinEndTime; // 报名截止时间
				if (!this.isNotNull(JoinEndTime)) {
				 // 提醒先选择报名截止时间
				 this.$u.toast("请先选择报名截止时间！");
					return;
				}

				let dateStr = e.year + "-" + e.month + "-" + e.day;

				// 报名截止时间 + 提交测评报告周期
				JoinEndTime = this.addDate(JoinEndTime, this.product.LimitDays);

				// 评级时间 > 报名截止时间 + 提交测评报告周期
				let diffValue = this.comparisonDate(dateStr, JoinEndTime);
				if (diffValue > 0) {
					// 校验通过则赋值
					this.product.EndTime = dateStr;
				} else {
					this.show1 = true;
				}

			},

			/**
			 * date为相加前的时间， days 为 需要相加的天数
			 * @param {Object} date
			 * @param {Object} days
			 */
			addDate(date, days) {
				var date = new Date(date);
				date.setDate(date.getDate() + days);
				var year = date.getFullYear();
				var month = date.getMonth() + 1;
				var day = date.getDate();
				var mm = "'" + month + "'";
				var dd = "'" + day + "'";
				if (mm.length == 3) {
					month = "0" + month;
				}
				if (dd.length == 3) {
					day = "0" + day;
				}
				var time = year + "-" + month + "-" + day;
				return time;
			},

			/**
			 * 计算日期差
			 * startTime 报名截止时间
			 * endTime   评级时间
			 * 返回天数差（大于0：表示报名截止时间 大于 评级时间 之后）
			 */
			comparisonDate(startTime, endTime) {
				// 日期格式化
				let start_date = new Date(startTime.replace(/-/g, "/"));
				let end_date = new Date(endTime.replace(/-/g, "/"));
				// 转成毫秒数，两个日期相减
				let ms = start_date.getTime() - end_date.getTime();
				// 转换成天数
				let day = parseInt(ms / (1000 * 60 * 60 * 24));
				// console.log("day = ", day);
				return day;
			},

			/**
			 * 前往付款
			 * 
			 * 1.检验数据
			 * 2.组装数据
			 * 
			 */
			async GoToPay() {

				// ----------start---------检验数据-----------start-------------------
				if (!this.isNotNull(this.product.JoinEndTime)) {
					this.showMSG('none', '请选择报名截止时间提交噢！')
					return
				}

				if (!this.isNotNull(this.product.EndTime)) {
					this.showMSG('none', '请选择评级时间提交噢！')
					return
				}

				// 报名截止时间 + 提交测评报告周期
				let JoinEndTime = this.addDate(this.product.JoinEndTime, this.product.LimitDays);

				// 评级时间 > 报名截止时间 + 提交测评报告周期
				let diff = this.comparisonDate(this.product.EndTime, JoinEndTime);
				if (diff < 0) {
					this.showMSG('none', '评级时间 应大于 报名截止时间 + 提交测评报告周期！')
					return
				}
				
				if (!this.KeyWordList.length > 0) {
					this.showMSG('none', '请添加关键字再提交噢 ！');
					return
				} else {
					// 解析标签
					this.product.KeyWord = this.ParseLabel(this.KeyWordList); // 关键字
				}
				
				
				// 测评需求
				if (JSON.stringify(this.EvaluationDemand) === '{}') {
					this.$u.toast("请选择测评需求！");
					return
				}
				
				// 商品主图
				if(this.MainPictureFiles.length > 0){
					this.product.MainPicture = this.MainPictureFiles[this.MainPictureFiles.length - 1].url;
				}
				
				// ----------end---------检验数据-----------end----------------------
				
				// ----------start---------组装数据-----------start-------------------
				this.product.DemandUnid = this.EvaluationDemand.id;// 测评需求记录唯一ID
				this.product.UserRatio = this.UserRatio.Value
				this.product.Initiatorid = uni.getStorageSync('userInfo').userId
				this.product.InitiatorName = uni.getStorageSync('userInfo').nickName
				this.product.Inspectorid = this.Inspector.Member
				this.product.InspectorName = this.Inspector.MemberName
				this.product.OriginalPrice = this.product.Price;// 市场价
				this.product.CouponAmount = (parseFloat(this.product.OriginalPrice) - parseFloat(this.product.CommodityPrice)).toFixed(2);// 市场价 - 玫丽专享价
				this.product.DiscountInfo = "[]";// 折扣信息
				
				// 私有团队编号
				if (this.isNotNull(this.PrivateTeam.TeamNo)) {
					this.product.PrivateTeamNo = this.PrivateTeam.TeamNo
				} else {
					this.product.PrivateTeamNo = ''
				}
				
				// 报名1次限制周期(天)
				this.product.JoinLimitDays = this.JoinLimitDays_text
				if(this.product.JoinLimitDays != '0'){
					this.product.EnableJoinLimit = '1';
				} else {
					this.product.EnableJoinLimit = '0';
				}
				
				// 测评等级要求
				if(this.RestrictionLevel_text == 'A级'){
					this.product.RestrictionLevel = 'A';
				} else if(this.RestrictionLevel_text == 'B级+'){
					this.product.RestrictionLevel = 'B';
				} else if(this.RestrictionLevel_text == 'C级+'){
					this.product.RestrictionLevel = 'C';
				} else if(this.RestrictionLevel_text == 'D级+'){
					this.product.RestrictionLevel = 'D';
				} else if(this.RestrictionLevel_text == 'E级+'){
					this.product.RestrictionLevel = 'E';
				} else if(this.RestrictionLevel_text == 'F级+'){
					this.product.RestrictionLevel = 'F';
				} else {
					this.product.RestrictionLevel = '';
				}
				
				// 活动面向群体。0:测评师；1:区域服务商
				if(this.EnableProviderJoinLimit_text == '区域服务商'){
					this.product.EnableProviderJoinLimit = '1';
				} else {
					this.product.EnableProviderJoinLimit = '0';
				}
				
				// 样品发放规则。0:自行购买；1:厂家发货；
				if(this.SampleDeliveryRules_text == '厂家发货'){
					this.product.SampleDeliveryRules = '1';
				} else {
					this.product.SampleDeliveryRules = '0';
				}
				
				// 是否开启分销功能
				if (this.EnableDistribution_text == '是') {
					this.product.EnableDistribution = '1';
				} else {
					this.product.EnableDistribution = '0';
				}
				// ----------end---------组装数据-----------end-------------------
				
				console.log("this.product", this.product);
			
				// 判断是否为后台配置支付特权人员
				if (this.PrivilegedStatus == "yes") {
					this.showItem = true;// 是，则可以选择支付额度
				} else {
					this.doWxPay('fullPayment');// 否，全额付款
				}

			},

			/**
			 * 选择支付的方式
			 */
			async clickPopup(item) {
				if (item.action == 'fullPayment' || item.action == 'payALittle'){
					this.doWxPay(item.action);
				} else if (item.action == 'closePopup') {
					this.showItem = false
				}
			},
			
			/**
			 * 关闭 选择支付的方式
			 */
			closePopup() {
				this.showItem = false;
			},
			
			/**
			 * 支付
			 */
			async doWxPay(action) {
				
				if(!this.isNotNull(this.EvaluationDemand.purchasePrice)){
					this.showMSG('error','应付金额为空，无法支付！');
					return;
				}
				
				// 显示 loading 提示框
				uni.showLoading({
					mask: true,
				});
				
				// 设置按钮为不可点击
				this.isClick = true;
				
				// 0.初始化订单信息
				// 格式化名字（名字超长处理）--- 暂不处理
				let Subject = this.FormatSubject(this.product.CommodityName, 25);
				
				let name = Subject + "-预存测评费用";
				let price = 0;
				
				if (action == 'fullPayment') {
					console.log("********全额付款***********");
					price = parseInt(this.EvaluationDemand.purchasePrice) * 100; // 全额付款
				}
				if (action == 'payALittle') {
					console.log("********支付0.01元***********");
					price = 1; // 支付一分钱
				}
				
				// 定义商品信息串，建议这些字段定义规范并且固定（例如商品件数等数据），好方便订单系统进行展示
				let goodsInfo = {};
				goodsInfo.goodsNum = '1件';// 件数
				goodsInfo.goodsWeight = '0kg';// 重量
				
				// 定义商家信息串，建议这些字段定义规范并且固定（例如下面这两个字段），好方便订单系统进行展示
				let mchInfo = {};
				mchInfo.mchname = this.product.MerchantName;// 商家名称
				mchInfo.mchimage = this.product.MerchantIcon;// 商家图标
				
				let obj = {};
				obj.userid = uni.getStorageSync('userInfo').userId;
				obj.openid = uni.getStorageSync('userInfo').openid;
				obj.tradeDesc = name;
				obj.payPrice = price; // 付款金额
				obj.productID = this.product.CommodityNo;// 商品编号
				obj.productUrl = '';// 订单详情页地址
				obj.imageUrl = this.product.CommodityPicture.split(',')[0];// 商品图片
				obj.goodsInfo = goodsInfo;
				obj.mchInfo = mchInfo;
				obj.remark = name;
				
				// 调用微信支付接口鉴权，返回鉴权信息
				let authinfo = await this.geAuthInfo(obj);
				console.info("支付接口1.authinfo=", authinfo);
				if(authinfo.code != 200){
					console.log("鉴权失败：" + authinfo);
					this.showMSG('error','支付失败！');
					this.isClick = false;// 设置按钮为可点击
					return;
				}
				
				
				// 调用 小程序支付统一接口，这里是以url判断是哪个接口的
				let url = "/api/unifiedorder";
				let respJson = await this.postWxpayServer(url, obj, authinfo);
				console.info("支付接口2.respJson=", respJson);
				if(respJson.code != 200){
					console.log("调用小程序支付统一接口失败：" + respJson.msg);
					this.showMSG('error','支付失败！');
					this.isClick = false;// 设置按钮为可点击
					return;
				}
				
				// 记录支付订单ID
				this.product.Orderid = respJson.data.tradeNo;
				
				// 开始发起支付动作
				let paymentdata = respJson.data;
				console.log("支付接口3.paymentdata=", paymentdata);
				
				// hasNext：true表示要发起微信支付，false表示已支付成功
				if(!paymentdata.hasNext){
					// 0元支付成功（表示写支付记录成功，并未真的进行支付）
					console.log("0元支付成功");
					// 付款成功后，提交流程
					this.placeOrder();
					return;
				}
				
				// 开始发起支付动作，进入到这里表示 hasNext = true，需要调用发起微信支付*/
				let that = this;
				wx.requestPayment({
					...paymentdata,
					success (res) {
						// 此处只能返回通信成功，返回的并不是支付成功，只能在complete中进行业务处理
						console.log("支付成功", res);
					},
					fail (err) {
						console.log("支付失败", err);
						// that.showMSG('error', '支付失败！');
						this.showItem = false;// 关闭 选择支付的方式
						that.isClick = false;// 设置按钮为可点击
					},
					complete(res){
						/**
						 * 延时查询订单是否支付成功；
						 * 1.支付成功，则提交流程
						 * 2.支付未成功，则弹窗提示(再执行一次支付，实际上是执行订单查询)
						 */
						setTimeout(() => {
							// 查询订单是否支付成功
							that.doQueryWxPayOk('first');
						}, 1500);
					}
				});
			},
			
			/**
			 * 查询订单是否支付成功
			 */
			async doQueryWxPayOk(action){
				let obj = {};
				obj.userid = uni.getStorageSync('userInfo').userId;
				obj.openid = uni.getStorageSync('userInfo').openid;
				obj.tradeNo = this.product.Orderid; // 交易成功的商户订单号
				let authinfo = await this.geAuthInfo(obj);
				console.info("查询订单是否支付成功接口1.authinfo=", authinfo);
				if(authinfo.code != 200){
					console.log("鉴权失败：" + authinfo);
					this.showMSG('error', '支付失败！');
					this.isClick = false;// 设置按钮为可点击
					return;
				}
				// 调用 查询小程序支付订单是否支付成功，这里是以url判断是哪个接口的
				let url = "api/queryorderok";
				let respJson = await this.postWxpayServer(url, obj, authinfo);
				console.info("查询订单是否支付成功接口2.respJson=", respJson);
				if(respJson.code != 200){
					console.log(action + "调用查询小程序支付订单是否支付成功失败：", respJson.msg);
					// 第一次调用
					if(action == 'first'){
						// 显示再调用一次的弹窗
						this.showPayInfo = true;
					}
					// 第二次调用
					if(action == 'second'){
						this.showMSG('error', '支付失败！');
						this.isClick = false;// 设置按钮为可点击
					}
					
				} else {
					// 付款成功后，提交流程
					this.placeOrder();
				}
			},
			
			/**
			 * 提交测评任务
			 */
			async placeOrder() {
				
				console.log("提交测评任务......");
				console.log("this.product=", this.product);
				let result = await this.$u.api.unifyRequest({
					appid: 'ProductPromote',
					wf_num: 'R_ProductPromote_BL003',
					WF_formData: this.product,
					docUnid: this.docUnid,
					loading: true // 默认发起请求会有一个全局的Loading，设置false可去掉
				});
				if (result.code == 200) {
					uni.hideLoading();
					uni.reLaunch({
						url: '/pages_private_scene2/ProductPromote/common/result?mode=1&Subject=' + this
							.product.CommodityName + '&MainDocUnid=' + this.docUnid
					});
				} else {
					this.$u.toast(result.msg);
				}
			},
			
			/**
			 * 格式化订单名字（名字超长处理）
			 * name：需要处理的字段
			 * MaxLength：要保留的最大长度，包含...
			 */
			FormatSubject(name, MaxLength) {
				let cutName = "";
				if (name.length > MaxLength) {
					// 超出的长度，需要截取
					let cutLength = name.length - (name.length - MaxLength) - 3; // 3表示三个省略号的长度
					cutName = name.substring(0, cutLength) + "...";
				} else {
					cutName = name;
				}
				return cutName;
			},
			
			/**
			 * 接收上传组件传过来的值并更新附件列表数据
			 * 获取附件列表（商品主图）
			 */
			async getMainPictureFiles(res) {
				this.MainPictureFiles = res;
			},
			
			/**
			 * 点击问号提示
			 */
			showTips(type) {
				if (type == 'LevelA') {
					this.TipsContent = this.TipsContentObj.LevelAContent
					this.TipsShow = true
				} else if (type == 'LevelANum') {
					this.TipsContent = this.TipsContentObj.LevelANumContent
					this.TipsShow = true
				} else if (type == 'LevelB') {
					this.TipsContent = this.TipsContentObj.LevelBContent
					this.TipsShow = true
				} else if (type == 'LevelBNum') {
					this.TipsContent = this.TipsContentObj.LevelBNumContent
					this.TipsShow = true
				} else if (type == 'LevelC') {
					this.TipsContent = this.TipsContentObj.LevelCContent
					this.TipsShow = true
				} else if (type == 'LevelCNum') {
					this.TipsContent = this.TipsContentObj.LevelCNumContent
					this.TipsShow = true
				} else if (type == 'PurchasePrice') {
					this.TipsContent = this.TipsContentObj.PurchasePriceContent
					this.TipsShow = true
				} else if (type == 'JoinEndTime') {
					this.TipsContent = this.TipsContentObj.JoinEndTimeContent
					this.TipsShow = true
				} else if (type == 'LimitDays') {
					this.TipsContent = this.TipsContentObj.LimitDaysContent
					this.TipsShow = true
				} else if (type == 'EndTime') {
					this.TipsContent = this.TipsContentObj.EndTimeContent
					this.TipsShow = true
				} else if (type == 'Rate') {
					this.TipsContent = this.TipsContentObj.RateContent
					this.TipsShow = true
				} else if (type == 'CS') {
					this.TipsContent = this.TipsContentObj.CSContent
					this.TipsShow = true
				} else if (type == 'UserRatio') {
					this.TipsContent = this.TipsContentObj.UserRatioContent
					this.TipsShow = true
				} else if (type == 'EnableJoinLimit') {
					this.TipsContent = this.TipsContentObj.EnableJoinLimitContent
					this.TipsShow = true
				} else if (type == 'OrganizeTeam') {
					this.TipsContent = this.TipsContentObj.OrganizeTeamContent
					this.TipsShow = true
				} else if (type == 'EnableDistribution') {
					this.TipsContent = this.TipsContentObj.EnableDistributionContent
					this.TipsShow = true
				} else if (type == 'OriginalPrice') {
					this.TipsContent = this.TipsContentObj.OriginalPriceContent
					this.TipsShow = true
				} else if (type == 'CouponAmount') {
					this.TipsContent = this.TipsContentObj.CouponAmountContent
					this.TipsShow = true
				} else if (type == 'DistributionReward') {
					this.TipsContent = this.TipsContentObj.DistributionRewardContent
					this.TipsShow = true
				} else if (type == 'Discount') {
					this.TipsContent = this.TipsContentObj.DiscountContent
					this.TipsShow = true
				}
			},
			
			/**
			 * 滚动到指定位置
			 */
			scroll(id){
				uni.createSelectorQuery().select("#"+id).boundingClientRect(data=>{//目标节点、也可以是最外层的父级节点
					uni.createSelectorQuery().select(".u-page").boundingClientRect((res)=>{//最外层盒子节点
						uni.pageScrollTo({
							duration:0,//过渡时间必须为0，uniapp bug，否则运行到手机会报错
							scrollTop: 5000
							// scrollTop:data.top,
							// scrollTop:res.top - data.top,//滚动到实际距离是元素距离顶部的距离减去最外层盒子的滚动距离
						});
					}).exec();
				}).exec();
			}
		}
	}
</script>

<style scoped>
	aui-flexView {
		width: 100%;
		height: 100%;
		margin: 0 auto;
		display: -webkit-box;
		display: -webkit-flex;
		display: -ms-flexbox;
		display: flex;
		-webkit-box-orient: vertical;
		-webkit-box-direction: normal;
		-webkit-flex-direction: column;
		-ms-flex-direction: column;
		flex-direction: column;
	}

	.aui-scrollView {
		width: 100%;
		height: 100%;
		-webkit-box-flex: 1;
		-webkit-flex: 1;
		-ms-flex: 1;
		flex: 1;
		overflow-y: auto;
		overflow-x: hidden;
		-webkit-overflow-scrolling: touch;
		position: relative;
		margin-top: 0;
	}

	.aui-navBar {
		height: 44px;
		position: relative;
		display: -webkit-box;
		display: -webkit-flex;
		display: -ms-flexbox;
		display: flex;
		z-index: 1002;
		background: #f7f7f7;
	}

	.b-line {
		position: relative;
	}

	.b-line:after {
		content: '';
		position: absolute;
		z-index: 2;
		bottom: 0;
		left: 0;
		width: 100%;
		height: 1px;
		border-bottom: 1px solid #e2e2e2;
		-webkit-transform: scaleY(0.5);
		transform: scaleY(0.5);
		-webkit-transform-origin: 0 100%;
		transform-origin: 0 100%;
	}

	.aui-navBar-item {
		height: 44px;
		min-width: 25%;
		-webkit-box-flex: 0;
		-webkit-flex: 0 0 25%;
		-ms-flex: 0 0 25%;
		flex: 0 0 25%;
		padding: 0 0.9rem;
		display: -webkit-box;
		display: -webkit-flex;
		display: -ms-flexbox;
		display: flex;
		-webkit-box-align: center;
		-webkit-align-items: center;
		-ms-flex-align: center;
		align-items: center;
		font-size: 0.7rem;
		white-space: nowrap;
		overflow: hidden;
		color: #353535;
		position: relative;
	}

	.aui-navBar-item:first-child {
		-webkit-box-ordinal-group: 2;
		-webkit-order: 1;
		-ms-flex-order: 1;
		order: 1;
		margin-right: -25%;
		font-size: 0.9rem;
		font-weight: bold;
	}

	.aui-navBar-item:last-child {
		-webkit-box-ordinal-group: 4;
		-webkit-order: 3;
		-ms-flex-order: 3;
		order: 3;
		-webkit-box-pack: end;
		-webkit-justify-content: flex-end;
		-ms-flex-pack: end;
		justify-content: flex-end;
	}

	.aui-center {
		-webkit-box-ordinal-group: 3;
		-webkit-order: 2;
		-ms-flex-order: 2;
		order: 2;
		display: -webkit-box;
		display: -webkit-flex;
		display: -ms-flexbox;
		display: flex;
		-webkit-box-pack: center;
		-webkit-justify-content: center;
		-ms-flex-pack: center;
		justify-content: center;
		-webkit-box-align: center;
		-webkit-align-items: center;
		-ms-flex-align: center;
		align-items: center;
		height: 44px;
		width: 50%;
		margin-left: 25%;
	}

	.aui-center-title {
		text-align: center;
		width: 100%;
		white-space: nowrap;
		overflow: hidden;
		display: block;
		text-overflow: ellipsis;
		font-size: 0.95rem;
		color: #333;
	}

	.icon {
		width: 20px;
		height: 20px;
		display: block;
		border: none;
		float: left;
		background-size: 20px;
		background-repeat: no-repeat;
	}

	.aui-flex {
		display: -webkit-box;
		display: -webkit-flex;
		display: flex;
		-webkit-box-align: center;
		-webkit-align-items: center;
		align-items: center;
		padding: 15px;
		position: relative;
	}

	.aui-flex-box {
		-webkit-box-flex: 1;
		-webkit-flex: 1;
		flex: 1;
		min-width: 0;
		font-size: 14px;
		color: #333;
	}

	.aui-flex-triangle {
		position: relative;
		font-size: 14px;
		padding-right: 15px;
	}

	.aui-flex-triangle:before {
		content: '';
		width: 0;
		height: 0;
		border-width: 5px 0px 5px 8px;
		border-style: solid;
		border-color: transparent transparent transparent #7b7b7b;
		position: absolute;
		top: 6px;
		right: 0;
		border-radius: 1;
	}

	.aui-choice-white {
		background: #fff;
	}

	.aui-order-box {
		padding: 10px 20px;
	}

	.aui-flex-goods {
		margin-right: .8em;
		width: 80px;
		height: 80px;
		line-height: 80px;
		text-align: center;
	}

	.aui-flex-goods img {
		width: 100%;
		max-height: 100%;
		vertical-align: top;
	}

	.aui-flex-default {
		background: #f3f1f1;
	}

	.aui-flex-default h2 {
		font-size: 14px;
		width: auto;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		word-wrap: normal;
		word-wrap: break-word;
		word-break: break-all;
		padding-bottom: 5px;
	}

	.aui-flex-default p {
		color: #999999;
		font-size: 12px;
	}

	.aui-flex-clear {
		padding: 0;
		margin-top: 20rpx;
	}

	.aui-flex-clear .aui-flex-box {
		color: #f21956;
		font-weight: bold;
	}

	.aui-mar15 {
		margin-bottom: 15px;
	}

	.aui-flex-triangle-clear:before {
		border-color: #fff;
	}

	.aui-flex-box h2 {
		font-size: 16px;
		padding-bottom: 5px;
	}

	.aui-flex-box h3 {
		font-size: 14px;
		padding-bottom: 5px;
	}

	.aui-flex-box p {
		font-size: 12px;
		color: #999;
		line-height: 1.2;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 1;
	}

	.aui-bar-footer {
		line-height: 52px;
		height: 52px;
		background: #fff;
		box-shadow: 0 -2px 10px #ddd;
		position: fixed;
		z-index: 999;
		bottom: 0;
		left: 0;
		width: 100%;
	}

	.aui-btn-button {
		background: #f21956;
		padding: 0 25px;
		color: #fff;
		font-size: 14px;
	}

	.aui-bar-footer .aui-flex {
		padding: 0;
	}

	.aui-bar-footer .aui-flex-box {
		padding-left: 15px;
	}

	.aui-bar-footer .aui-flex-box span {
		font-style: normal;
		color: #eb5468;
	}

	.cnt {
		padding-top: 1px;
		color: #e61111;
		position: relative;
		line-height: 22px;
		font-size: 14px;
		font-weight: 500;
	}

	.popup-box {
		padding-bottom: 50rpx;
		padding-top: 50rpx;
	}

	.popup-item {
		height: 100rpx;
		line-height: 100rpx;
		text-align: center;
		font-size: 33rpx;
	}

	.discount_info {
		border-bottom: 1px solid black;
		border-left-width: 0;
		border-top-width: 0;
		border-right-width: 0;
		width: 50px;
		height: 30px;
		text-align: center;
		padding-left: 15px;
	}

	.swipe-content {
		display: flex;
		flex-direction: row;
		background: #fff;
		border-bottom: 1rpx solid #eee;
		line-height: 35px;
	}
	
	.richtext-block{
		background: #f3f3f3;
		width: 100%;
		margin:0 auto;
		border-radius:5px;
		padding: 20rpx;
		height: 540rpx;
	}
	
	.aui-flex-tags{
		width: 435rpx;
		text-align: left;
	}
	
	.mod-richtext{
		padding: 15px;
		height: 450px;
		overflow-y: scroll;
	}
	
	.Tips {
		font-size: 24rpx;
		line-height: 24rpx;
		margin-top: 12rpx;
		color: #9a9a9a;
		/* padding: 30rpx;
		margin: 0; */
		word-break: break-all;
		-webkit-overflow-scrolling: touch;
		-webkit-tap-highlight-color: transparent;
		text-size-adjust: 100%;
		box-sizing: border-box;
	}
	
</style>
